<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 
        then 触发resolve catch触发 reject
        
         then   --触发之后的结果是promise，还是fulfilled
         catch  --触发之后的结果是promise, 还是fulfilled   
    -->
    <script>
        var p = Promise.resolve(10);
        console.log(p);             
        var result = p.then(res=>{
            console.log(res);
        })
        console.log(result);


        var r = Promise.reject(20);
        console.log(r);
        var re = r.catch(res=>{
            console.log(res);
        })
        console.log(re);
    </script>
</body>
</html>